package com.peng.test.lock1;

/**
 * ForMain
 *
 * @author: lupeng6
 * @create: 2020/11/25 17:27
 */
public class ForMain {


    public static void main(String[] args) throws InterruptedException {
        Thread1 target = new Thread1();
        new Thread(target).start();
        new Thread(target).start();
        new Thread(target).start();
        new Thread(target).start();
    }
}

class Thread1 implements Runnable {
    @Override
    public void run() {
        synchronized (this) {
            while (true) {
                System.out.println(1);
            }
        }
    }
}
